<?php
	include "layout.php";
	head();
	if (!isset($_SESSION["id"])) {
		header("Location: index.php");
	}
?>
<h4 style="text-align: center;">Select an Order to Printout</h4>
<?php
	$query = mysql_query("SELECT * FROM orderconfig WHERE OA_Cust_ID = {$_SESSION["id"]}");
	$count = mysql_num_rows($query);
	if ($count != 0) {
?>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<th>Order ID</th>
		<th>Date Completed</th>
	</tr>
<?php
		while ($results = mysql_fetch_array($query)) {
			echo <<<Receipt
	<tr>
		<td><a href='#' onclick='print({$results["OrderAcc_ID"]})'>Order #{$results["OrderAcc_ID"]}</a></td>
		<td>{$results["OrderAcc_Date"]}</td>
	</tr>
Receipt;
		}
?>
</table>
<?php
	}
	else {
?>
<p>You haven't completed any orders.</p>
<?php
	}
?>
<?php
	foot();
?>